package zuoye3;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        //card.payMoney();
        //card1.payMoney();
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入会员卡类型：1.金卡 2.银卡");
        String type = sc.next();
        System.out.println("请输入支付金额：");
        double paymoney = sc.nextDouble();
        switch (type) {
            case "1":
                Card card = new GoldenCard("123456789", 1000, 1);
                card.payMoney( card.getMoney(),paymoney);
                break;
            case "2":
                Card card1 = new SilverCard("123456789", 1000, 2);
                card1.payMoney( card1.getMoney(),paymoney);
                break;
            default:
                System.out.println("输入错误");

                break;
        }
    }
}
